/**
 * @filename:Term.java
 * Copyright(c) 2020 cyq9990
 * All right reserved.
 */

package com.cyq.api.modules.term.wrapper;

import com.cyq.api.modules.common.entity.User;
import com.cyq.api.modules.term.dto.UserDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 *
 * @Description:  学期模块 - 数据转换，支持多对一的转化
 * @Author:       cyq9990
 * @CreateDate:   Tue May 19 11:32:05 CST 2020
 * @Version:      V1.0
 *
 */

@Mapper(componentModel="spring")
public interface TermDTOWrapper {

    @Mappings({
            @Mapping(source = "term.id", target = "id"),
            @Mapping(source = "term.title", target = "title"),
            @Mapping(source = "term.companyId", target = "companyId"),
            @Mapping(source = "term.khCompanyId", target = "khCompanyId"),
            @Mapping(source = "term.status", target = "status"),
            @Mapping(source = "term.remarks", target = "remarks"),
            @Mapping(source = "term.videoCount", target = "videoCount"),
            @Mapping(source = "term.writerScore", target = "writerScore"),
            @Mapping(source = "term.operationScore", target = "operationScore"),
            @Mapping(source = "term.reExam", target = "reExam"),
            @Mapping(source = "term.examAllowCount", target = "examAllowCount"),
            @Mapping(source = "term.examType", target = "examType"),
            @Mapping(source = "term.autoCreate", target = "autoCreate"),
            @Mapping(source = "term.chargeType", target = "chargeType"),
            @Mapping(source = "term.limitMonth", target = "limitMonth"),
            @Mapping(source = "term.belongYear", target = "belongYear"),
            @Mapping(source = "term.lessonCount", target = "lessonCount"),
            @Mapping(source = "term.classType", target = "classType"),
            @Mapping(source = "term.saleExpireDate", target = "saleExpireDate"),
            @Mapping(source = "term.useExpireDate", target = "useExpireDate"),
            @Mapping(source = "term.forbidDateBegin", target = "forbidDateBegin"),
            @Mapping(source = "term.forbidDateEnd", target = "forbidDateEnd"),
            @Mapping(source = "term.termShowType", target = "termShowType"),
            @Mapping(source = "term.cover", target = "cover"),
            @Mapping(source = "term.isViolation", target = "isViolation"),
            @Mapping(source = "term.industryId", target = "industryId"),
            @Mapping(source = "term.videoGroupId", target = "videoGroupId"),
            @Mapping(source = "term.minutesBetween", target = "minutesBetween"),
            @Mapping(source = "term.termCategory", target = "termCategory"),
            @Mapping(source = "term.isAuthentication", target = "isAuthentication"),
            @Mapping(source = "term.practiceId", target = "practiceId"),
            @Mapping(source = "term.tryVideoSectionId", target = "tryVideoSectionId"),
            @Mapping(source = "term.isPublic", target = "isPublic"),
            @Mapping(source = "term.publicKId", target = "publicKId"),
            @Mapping(source = "term.ctime", target = "ctime"),
            @Mapping(source = "term.utime", target = "utime"),
            @Mapping(source = "term.createUser", target = "createUser"),
            @Mapping(source = "term.modifyUser", target = "modifyUser"),
            @Mapping(source = "term.isDel", target = "isDel"),
            @Mapping(source = "term.expiredTime", target = "expiredTime"),
            @Mapping(source = "term.startTime", target = "startTime"),
            @Mapping(source = "term.examId", target = "examId"),
            @Mapping(source = "term.lessonTime", target = "lessonTime"),
    })

    /*optional*/
    TermDTO domain2dto(Term term);

    /*optional*/
    List<TermDTO> domain2dto(List<Term> terms);

}
